home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / ai.prl / dprolog.lha / election.pro < prev    next >
Text File  |  1991-03-05  |  1KB  |  56 lines

  1.  
  2. nominate(republicans,bush):=true.
  3.  
  4. nominate(republicans,dole):=
  5.         neg nominate(republicans,bush).
  6.  
  7. nominate(republicans,kemp):=
  8.         neg nominate(republicans,bush),
  9.         neg nominate(republicans,dole).
  10.  
  11. neg nominate(republicans,bush):=
  12.         neg supports(reagan,bush).
  13.  
  14. nominate(democrats,mondale):=
  15.         neg runs(kennedy),
  16.         neg nominate(republicans,bush).
  17.  
  18. nominate(democrats,kennedy):=
  19.         runs(kennedy),
  20.         supports(carter,mondale).
  21.  
  22. nominate(democrats,hart):=
  23.         neg nominate(democrats,kennedy),
  24.         neg nominate(democrats,mondale).
  25.  
  26. elected(Candidate1):=
  27.         nominate(republicans,Candidate1),
  28.         nominate(democrats,Candidate2),
  29.         supports(carter,Candidate2).
  30.  
  31. elected(kennedy):=
  32.         nominate(democrats,kennedy),
  33.         nominate(republicans,Candidate),
  34.         neg supports(reagan,Candidate).
  35.  
  36. supports(reagan,kemp).
  37.  
  38. supports(carter,mondale).
  39.  
  40. neg supports(Politician,Candidate2):-
  41.         supports(Politician,Candidate1),
  42.         Candidate2\=Candidate1.
  43.  
  44. runs(bush).
  45.  
  46. runs(dole).
  47.  
  48. runs(kemp).
  49.  
  50. runs(mondale).
  51.  
  52. runs(hart).
  53.  
  54. neg runs(kennedy):=true.
  55.  
  56.